package com.itheima.d2_pool;

import java.util.concurrent.Callable;

//1.为Demo02准备的任务类
public class MyCallable implements Callable<String> {

    int num;

    public MyCallable(int num) {
        this.num = num;
    }

    @Override
    public String call() throws Exception {
        //2.任务还是打印数字
        System.out.println(Thread.currentThread().getName() + "执行：任务" + num);

        //3.返回结果
        return "执行成功！";
    }
}
